<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../js/vue.js"></script>
    <script src="../js/axios.js"></script>
    <script src="../js/util.js"></script>
</head>
<body>
<div id="a">
    <center><h2> 教师统计数据：</h2></center>
    <br>
    <div v-for="s in list" style="color: red"><font style="color:black;">学生最多的老师:</font>{{s.tname}}</div>
    学生数量大于2的老师:<span v-for="a in array" style="color: red">{{a.tname}} </span>
</div>
<script>
    new Vue({
        el: "#a",
        data: {
            list: [],
            array: []
        },
        created() {
            this.findTeaByMaxStu()
            this.findTeaByCountStu();
        },
        methods: {
            findTeaByMaxStu() {
                axios.post("/sys/statistics/findTeaByMaxStu").then(res => {
                    this.list = res.data.data
                })
            },
            findTeaByCountStu() {
                axios.post("/sys/statistics/findTeaByCountStu").then(res => {
                    this.array = res.data.data
                })
            }
        }
    })
</script>
</body>
</html>